package c.a.a.z.b;

import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Matrix;
import c.a.a.b0.k.p;
import c.a.a.b0.l.b;
import c.a.a.f0.c;
import c.a.a.l;
import c.a.a.q;
import c.a.a.z.c.a;

/* compiled from: StrokeContent */
public class r extends a {
    public final b o;
    public final String p;
    public final boolean q;
    public final a<Integer, Integer> r;
    public a<ColorFilter, ColorFilter> s;

    public r(l lVar, b bVar, p pVar) {
        super(lVar, bVar, pVar.g.a(), pVar.h.a(), pVar.i, pVar.e, pVar.f, pVar.c, pVar.b);
        this.o = bVar;
        this.p = pVar.a;
        this.q = pVar.j;
        a a = pVar.d.a();
        this.r = a;
        a.a.add(this);
        bVar.e(a);
    }

    public String a() {
        return this.p;
    }

    public void g(Canvas canvas, Matrix matrix, int i) {
        if (!this.q) {
            c.a.a.z.c.b bVar = (c.a.a.z.c.b) this.r;
            this.i.setColor(bVar.j(bVar.a(), bVar.c()));
            a aVar = this.s;
            if (aVar != null) {
                this.i.setColorFilter((ColorFilter) aVar.e());
            }
            super.g(canvas, matrix, i);
        }
    }

    public <T> void i(T t, c<T> cVar) {
        super.i(t, cVar);
        a aVar;
        if (t == q.b) {
            aVar = this.r;
            c cVar2 = aVar.e;
            aVar.e = cVar;
        } else if (t == q.C) {
            aVar = this.s;
            if (aVar != null) {
                this.o.u.remove(aVar);
            }
            if (cVar == null) {
                this.s = null;
                return;
            }
            c.a.a.z.c.p pVar = new c.a.a.z.c.p(cVar, null);
            this.s = pVar;
            pVar.a.add(this);
            this.o.e(this.r);
        }
    }
}
